const express = require('express');
const router = express.Router();
const { sqlFn } = require('../mysql');

router.get('/', (req, res, next) => {
    const sql = 'SELECT * FROM test';
    sqlFn(sql, [], (err, results) => {
        if (err) {
            return next(err);
        }
        res.json({ code: 200, data: results });
    });
});

module.exports = router;